# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# pyojo                                           Copyright (c) 2011 nabla.net
# ----------------------------------------------------------------------------
""" Demo: pyojo.js.dijit.DropDownButton
"""
from pyojo.all import *
from pyojo.js.lib.demo import new_panel

def GET(request):

   
    
    menu = dijit.DropDownMenu(var=True, 
                              style="display: none;");
    #menu.startup = False
    
    menuitem = dijit.MenuItem(label= "Delete",
        iconClass=ICON_EDIT["Delete"],
        onClick=js.Function("status('MenuDelete.onClick')")).add(menu.var)
    
    menuitem2 = dijit.MenuItem(label= "Save",
        iconClass=ICON_EDIT["Save"],
        onClick=js.Function("status('MenuSave.onClick')")).add(menu.var)
    
    button = form.DropDownButton(var = True,
                         label = 'Button', 
                         dropDown = js.Code(menu.var),
                         onClick = js.Function("status('Button.onClick')"),
                         iconClass="pyojoIconAccept")
    
    
    panel = new_panel("Demo DropDownButton", "TABS")
    html = "<p>%s</p>" % raw_str(__doc__)
    html += "<pre>%s</pre>" % raw_str(form.DropDownButton.__doc__)
    
    panel.member["content"] = html
    return js.Require(menu,
                      menuitem,
                      menuitem2,
                      button,
                      panel,
                      panel.domNode.appendChild(button.domNode),
                      "status('Form Buttons demo ready.');")


     


"""
dom.byId("dropDownButtonContainer").appendChild(button.domNode);
"""